function dump()
{
    var s = "";

    for (i in arguments) {
        s += arguments[i];
    }

    s += "<br />";

    document.write(s);
}

function window_test()
{
    dump("<br />========== window =============");

    window.name = "hello";

    dump("name: ", window.name);
    dump("length: ", window.length);
    dump("opener: ", window.opener);
    dump("closed: ", window.closed);
    dump("parent: ", window.parent);
    dump("top: ", window.top);
    dump("self: ", window.self);
    dump("status: ", window.status);
    dump("defaultStatus: ", window.defaultStatus);
    dump("frames: ", window.frames);
    dump("innerHeight: ", window.innerHeight);
    dump("innerWidth: ", window.innerWidth);
    dump("outerHeight: ", window.outerHeight);
    dump("outerWidth: ", window.outerWidth);
    dump("pageXOffset: ", window.pageXOffset);
    dump("pageYOffset: ", window.pageYOffset);
    dump("screenLeft: ", window.screenLeft);
    dump("screenTop: ", window.screenTop);
    dump("screenX: ", screenX);
    dump("screenY: ", screenY);

  /*
   * if (confirm("显示带有一段消息以及确认按钮和取消按钮的对话框"))
   *    alert("显示带有一段消息和一个确认按钮的警告框");
   * else
   *    dump("prompt接受的内容: ", prompt("显示可提示用户输入的对话框: ", "输入框里的默认值"));
   */

    //调出打印选项打印本页面
  // print();

    //创建新窗口
    var w = open("./1_javascript.html", "OpenJS", "toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");
    //调整新窗口位置
    w.moveTo(0, 0);
    //改变新窗口大小
    w.resizeTo(200, 200);
    // 关闭新窗口
    // w.close();

    var i = 0;
    //周期执行
    var timeid = setInterval(function(){
        w.scrollBy(0, 10);
        console.log("Interval " + i);
        i++;
    }, 1000);

    //延时执行
    setTimeout(function(){
        clearInterval(timeid);
        w.close();
    }, 10000);
}
// window_test();

function other_test()
{
    // location    导航信息(URL信息)
    dump("<br />========== location =============");
    dump("hash: ", location.hash);
    dump("protocol: ", location.protocol);
    dump("host: ", location.host); //保存主机名加端口号
    dump("hostname: ", location.hostname);
    dump("port: ", location.port);
    dump("search: ", location.search);
    dump("pathname: ", location.pathname);
    dump("href: ", location.href);
    //修改href值实现跳转页面
    // location.href = "1_javascript.html";
    //实现刷新页面功能
    // location.reload();

    // history     历史访问记录操作对象
    dump("<br />========== history =============");
    dump("history.length: ", history.length);
    // 刷新页面功能
    // history.go(0);
    // 跳转到前一历史记录(可以改变数字选择跳转前几个)
    // history.go(1);
    // 跳转到后一历史记录
    // history.go(-1);

    // navigator  浏览器信息和操作系统信息对象
    dump("<br />========== navigator =============");
    dump("appCodeName: ", navigator.appCodeName);
    dump("appName: ", navigator.appName);
    dump("appVersion: ", navigator.appVersion);
    dump("cookieEnabled: ", navigator.cookieEnabled);
    dump("platform: ", navigator.platform);
    dump("userAgent: ", navigator.userAgent);

    // screen  屏幕信息
    dump("<br />========== screen =============");
    // 返回屏幕的高度（不包括Windows任务栏）
    dump("availHeight:", screen.availHeight);
    // 返回屏幕的宽度（不包括Windows任务栏）
    dump("availWidth:", screen.availWidth);
    // 返回屏幕的总高度
    dump("height:", screen.height);
    //返回屏幕的总宽度
    dump("width:", screen.width);
    // 返回屏幕的颜色分辨率（每象素的位数）
    dump("pixelDepth:", screen.pixelDepth);
}
other_test();
